<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{_fragments::common_header(~{::title})}">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <title>版块管理 - 逍遥论坛</title>
   <link href="../../static/css/bootstrap.min.css" th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
    <script src="../../static/js/jquery-3.2.1.js" th:src="@{/static/js/jquery-3.2.1.js}"></script>
    <script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}"></script>
    <style>
        li {list-style-type:none;}
        a{
            color: #8A8A8A;
            cursor: pointer;
        }

        th {
            text-align:center; /*设置水平居中*/
            /* vertical-align:middle; */ /*设置垂直居中*/
        }
        td {
            text-align:center; /*设置水平居中*/
            /* vertical-align:middle; */ /*设置垂直居中*/
            /* border: 1px solid gray; */
        }
    </style>
</head>
<body>

<!-- 弹出结果 -->
<c:if test="${not empty myInfo}">
    <script type="text/javascript" language="javascript">
        {
            alert("<%=request.getAttribute("myInfo")%>");
        }
    </script>
</c:if>

<!-- 引入header文件 -->
<header th:replace=" _fragments:: header"></header>

<div class="panel panel-default"
     style="width: 50%;margin-left: 5%; margin-right: 5%; margin-bottom: 5%">
    <div class="panel-heading" style="background-color: #fff">
        <h3 class="panel-title">版块管理</h3>
    </div>
    <div class="panel-body">
        <a type="button" class="btn btn-success"
               style="margin-left: 0%" th:href="toAddForumPage.do" >添加版块</a>
            <!-- 这里显示所有版块信息 -->
            <table class="table">
                <thead>
                <tr>
                    <th style="width: 100px">版块ID</th>
                    <th style="width: 160px">版块名</th>
                    <th style="width: 200px">操作</th>
                </tr>
                </thead>
                <tbody>
                <!-- 这里是表格内容，需要遍历数组 -->
                <c:forEach items="${forums}" var="forum">
                    <tr th:each="forum,iterStat: ${forum}">
                        <td th:text="${forum.forumId}"></td>
                        <td th:text="${forum.forumName}">${forum.forum_name}</td>
                        <td><!-- 这里放操作按钮 -->
                           <!--  <input type="button" class="btn btn-warning" value="修改"
                                   onclick="window.location.href='<%=basePath%>toModifyForumPage.do?forumId=${forum.forum_id}'"/>
                            <input type="button" class="btn btn-danger" value="删除（未实现）"
                                   onclick="window.location.href='<%=basePath%>disEnableForum.do?forumId=${forum.forum_id}'"/> -->
                                   <a type="button" class="btn btn-warning"
                                   th:href="'toModifyForumPage.do?forumId='+${forum.forumId}">修改</a>
                            <a type="button" class="btn btn-danger"
                                   th:href="'disEnableForum.do?forumId='+${forum.forumId}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
             <a type="button" class="btn btn-default"
                   style="margin-left: 20%" th:href="toMainPage.do">返回</a>
    </div>
</div>

<!-- 引入footer文件 -->
<footer th:replace="_fragments:: footer"></footer>

</body>
</html>